package com.mhs.pb.domain;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Basicinfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "basicinfo", catalog = "PersonalRelation")
public class Basicinfo implements BaseEntity {

	// Fields
    private static final long serialVersionUID = -9126085378165802257L;
	private Long id;
	private String name;
	private String nickname;
	private String usednames;
	private String cellphones;
	private String contacts;
	private String phones;
	private String addresses;
	private Date birth;
	private String nation;
	private String favors;
	private String goodat;
	private String taboos;
	private Set<Relation> relations = new HashSet<Relation>(0);

	// Constructors

	/** default constructor */
	public Basicinfo() {
	}

	/** minimal constructor */
	public Basicinfo(String name) {
		this.name = name;
	}

	/** full constructor */
	public Basicinfo(String name, String nickname, String usednames,
			String cellphones, String contacts, String phones,
			String addresses, Date birth, String nation, String favors,
			String goodat, String taboos, Set<Relation> relations) {
		this.name = name;
		this.nickname = nickname;
		this.usednames = usednames;
		this.cellphones = cellphones;
		this.contacts = contacts;
		this.phones = phones;
		this.addresses = addresses;
		this.birth = birth;
		this.nation = nation;
		this.favors = favors;
		this.goodat = goodat;
		this.taboos = taboos;
		this.relations = relations;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "name", nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "nickname")
	public String getNickname() {
		return this.nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	@Column(name = "usednames")
	public String getUsednames() {
		return this.usednames;
	}

	public void setUsednames(String usednames) {
		this.usednames = usednames;
	}

	@Column(name = "cellphones", length = 1000)
	public String getCellphones() {
		return this.cellphones;
	}

	public void setCellphones(String cellphones) {
		this.cellphones = cellphones;
	}

	@Column(name = "contacts", length = 1000)
	public String getContacts() {
		return this.contacts;
	}

	public void setContacts(String contacts) {
		this.contacts = contacts;
	}

	@Column(name = "phones", length = 1000)
	public String getPhones() {
		return this.phones;
	}

	public void setPhones(String phones) {
		this.phones = phones;
	}

	@Column(name = "addresses", length = 1000)
	public String getAddresses() {
		return this.addresses;
	}

	public void setAddresses(String addresses) {
		this.addresses = addresses;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "birth", length = 10)
	public Date getBirth() {
		return this.birth;
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}

	@Column(name = "nation", length = 20)
	public String getNation() {
		return this.nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	@Column(name = "favors", length = 65535)
	public String getFavors() {
		return this.favors;
	}

	public void setFavors(String favors) {
		this.favors = favors;
	}

	@Column(name = "goodat", length = 65535)
	public String getGoodat() {
		return this.goodat;
	}

	public void setGoodat(String goodat) {
		this.goodat = goodat;
	}

	@Column(name = "taboos", length = 65535)
	public String getTaboos() {
		return this.taboos;
	}

	public void setTaboos(String taboos) {
		this.taboos = taboos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "basicinfo")
	public Set<Relation> getRelations() {
		return this.relations;
	}

	public void setRelations(Set<Relation> relations) {
		this.relations = relations;
	}

}